const express = require('express');
const app = express();
const port = 3000;

const student = [
    {name: '张三',class: '三年二班'},
    {name: '李四',class: '三年一班'},
    {name: '张三',class: '三年二班'}
]

app.get('/', (req, res) => {
  res.send('Hello World!');
});

app.get("/student",(req,res)=>{
    const stus = JSON.stringify(student);
    const  { callback } = req.query;
   res.send(`${callback}(${stus})`);
//    res.send(`alert(555)`)
})

app.listen(port, () => {
  console.log(`服务器启动成功了：`,port);
});